function totalSum(){
		var total=0;
		$(".ui-block-contentL").find("a[aria-valuenow]").each(function(index, element) {
			var _val=0;
			_val=parseInt($(this).attr("aria-valuenow"));
			total+=parseInt(_val);
			//var _inputVal=$(".ui-block-contentL input").eq(index).val().toString();
			//_inputVal=_inputVal.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
			//$(".ui-block-contentL input").eq(index).val(_inputVal);
        });
		$(".yrttl").text(total);
		$(".yrttl").text("$" + $(".yrttl").text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") );
	}
function addChkbox(){
		$(".bulText span").before("<span><input type='checkbox' id='chkBtn'/><label for='chkBtn'>"
		+$(".bulText span").text()
		+"</label></span>");
		$(".bulText span:last").remove();
}
function formatInput(){
	$(".ui-block-contentL input").attr("type","text");
}
function TC_Click(){
	$(".termcond").click(function(){
		$("#mask").show();
	});
	$("#close").click(function(){
		$("#mask").hide();
	});

}
	$(document).ready(function(e) {
		totalSum();
		addChkbox();
		formatInput();
		TC_Click();
		$( ".ui-block-contentL input" ).each(function(index, element) {
            var _Value=$(this).val().toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
			$(this).val(_Value);
        });
		$(".ui-block-contentL input").bind("change paste keyup", function() {
   			totalSum();
		});
		$( ".ui-block-contentL input" ).on( 'slidestop', function() {
			var _Value=$(this).val().toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
			$(this).val(_Value);
		});
    });